# Contributor: Olliver Schinagl <oliver@schinagl.nl>
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
pkgname=stress-ng
pkgver=0.11.00
pkgrel=1
pkgdesc="stress-ng will stress test a computer system in various selectable ways"
url="https://kernel.ubuntu.com/~cking/stress-ng/"
arch="all !mips !mips64"
license="GPL-2.0-or-later"
options="!check" # tests are not portable
makedepends="
	libaio-dev
	libbsd-dev
	linux-headers
	lksctp-tools-dev
	zlib-dev
	"
subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="https://kernel.ubuntu.com/~cking/tarballs/stress-ng/stress-ng-$pkgver.tar.xz
	fix-kernel-header-detection.patch"

build() {
	make
}

package() {
	make DESTDIR="$pkgdir" \
		JOBDIR="/usr/share/doc/$pkgname/example-jobs/" install
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	amove usr/share/bash-completion/completions
}

sha512sums="d10ad50c2acb6ab53926155fd382c409bbf832a944ec1c3f3ba1c0266cc685dae2bb2c3e24f59e039eea438ad79d5efaafe02745e0e08b9d919894461e2bc49a  stress-ng-0.11.00.tar.xz
d444d2f0bc1969b133f8a915592079efdb049f08a4e13e4cfa078dc856015bbeb499abb47817b088a935096fe28c748d328f6907138eea6ec47f51efcd0d6889  fix-kernel-header-detection.patch"
